<?php
/**
 * Created by PhpStorm.
 * User: Zhoujinda
 * Date: 2016/3/15
 * Time: 18:42
 */
namespace app\index\domain;

use app\index\domain\BaseDomain;
use app\shop\api\StorePromotionApi;

class StorePromotionDomain extends BaseDomain{
    protected $business_code = "storePromotion";
    /**
     * 获取店铺优惠信息
     */
    public function getInfo(){

        if(IS_POST){
            $this -> checkVersion($this->api_ver);
            addLog("StorePromotion/getInfo",$_GET,$_POST,$this->client_id."调用店铺优惠信息查询接口");
            $store_id = $this->_post('store_id','','店铺ID缺失');
            $r = apiCall(StorePromotionApi::GET_INFO,[['store_id'=>$store_id]]);
            if($r['status']){
                if(empty($r['info'])) $this->apiReturnErr('此店铺暂无优惠');
                else $this->apiReturnSuc($r['info']);
            }else{
                $this->apiReturnErr('查询失败');
            }

        }else{
            $this->apiReturnErr('只支持POST请求');
        }

    }
}